using System.Drawing;

namespace DataStubGenerator.Controls
{
    public class Highlight
    {
        public int Position
        {
            get { return _position; }
        }

        private readonly int _position;

        public int Length
        {
            get { return _length; }
        }

        private readonly int _length;

        public Color Color
        {
            get { return _color; }
        }

        private readonly Color _color;

        public Highlight(int position,int length,Color color)
        {
            _position = position;
            _length = length;
            _color = color;
        }

        public override string ToString()
        {
            return string.Format("position {0}; length {1}; color {2};", _position, _length, _color);
        }

        public override bool Equals(object other)
        {
            if(other==null) return false;
            if(!(other is Highlight)) return false;

            Highlight otherHighlight = (Highlight) other;

            return
                _position == otherHighlight.Position &&
                _length == otherHighlight.Length &&
                _color == otherHighlight.Color;
        }
    }
}